﻿using Masuit.Tools.Security;
using System;
using System.Security.Cryptography;
using System.Text;
using adb;

namespace PowerStation.RequestModel
{
    /// <summary>
    /// 统计数据
    /// </summary>
    public class RequestStatisticsModel
    {
        /// <summary>
        /// 统计的标题
        /// </summary>
        public string title { get; set; }
        /// <summary>
        /// 值
        /// </summary>
        public decimal value { get; set; }
    }

    /// <summary>
    /// 临时使用
    /// </summary>
    public class TemStatisticsModel {
        /// <summary>
        /// 值
        /// </summary>
        public decimal value;
        /// <summary>
        /// 值2
        /// </summary>
        public decimal value2;
        /// <summary>
        /// 时间
        /// </summary>
        public DateTime time;
    }
    /// <summary>
    /// 临时天数据
    /// </summary>
    public class TemDayData { 

        /// <summary>
        /// 时间
        /// </summary>
        public DateTime time { get; set; }
        /// <summary>
        /// 电站ID
        /// </summary>
        public decimal powerStationId { get; set; }
        /// <summary>
        /// 区域ID
        /// </summary>
        public decimal areaId { get; set; }
        /// <summary>
        /// 设备ID
        /// </summary>
        public string deviceSN { get; set; }
        /// <summary>
        /// 刷新标准,如果有需要刷新的数据可以用这个来做标记
        /// </summary>
        public string reflushKey { get; set; }
        /// <summary>
        /// 值
        /// </summary>
        public decimal value { get; set; }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {


            return ($"day_{powerStationId}_{areaId}_{deviceSN}_{reflushKey}_{time:yyyyMMdd}").GetDeterministicHashCode();
            
        }
    }

    /// <summary>
    /// 临时月数据
    /// </summary>
    public class TemMonthData
    {

        /// <summary>
        /// 时间
        /// </summary>
        public DateTime time { get; set; }
        /// <summary>
        /// 值
        /// </summary>
        public decimal value { get; set; }
        /// <summary>
        /// 电站ID
        /// </summary>
        public decimal powerStationId { get; set; }
        /// <summary>
        /// 区域ID
        /// </summary>
        public decimal areaId { get; set; }
        /// <summary>
        /// 设备ID
        /// </summary>
        public string deviceSN { get; set; }
        /// <summary>
        /// 刷新标准,如果有需要刷新的数据可以用这个来做标记
        /// </summary>
        public string reflushKey { get; set; }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            return $"month_{powerStationId}_{areaId}_{deviceSN}_{reflushKey}_{time:yyyyMM}".GetDeterministicHashCode();
        }
    }

    /// <summary>
    /// 临时年数据
    /// </summary>
    public class TemYearData
    {

        /// <summary>
        /// 时间
        /// </summary>
        public DateTime time { get; set; }
        /// <summary>
        /// 值
        /// </summary>
        public decimal value { get; set; }
        /// <summary>
        /// 电站ID
        /// </summary>
        public decimal powerStationId { get; set; }
        /// <summary>
        /// 区域ID
        /// </summary>
        public decimal areaId { get; set; }
        /// <summary>
        /// 设备ID
        /// </summary>
        public string deviceSN { get; set; }
        /// <summary>
        /// 刷新标准,如果有需要刷新的数据可以用这个来做标记
        /// </summary>
        public string reflushKey { get; set; }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            return $"year_{powerStationId}_{areaId}_{deviceSN}_{reflushKey}_{time:yyyy}".GetDeterministicHashCode();
        }
    }

}
